/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Thread;

import vectors.VectorIn;

/**
 *
 * @author Кирилл
 */
public class ThreadForFill extends Thread {

    private VectorIn vector;
    private double min = 0;
    private double max = 1000.0;

    public ThreadForFill(VectorIn vector) throws CloneNotSupportedException {
        this.vector = (VectorIn) vector.clone();
    }
    public VectorIn get(){
        return vector;
    }
    private void write() {
        double val;
        for (int i = 0; i < vector.getSize(); i++) {
            val = min + Math.random() * (max - min);
            vector.setElement(val, i);
            System.out.println("Write " + val + " to position " + i + "");

        }
    }

    public void run() {
        write();
    }
}
